load("@rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "pps",
    srcs = [
        "filter.go",
        "pps.go",
        "pps.pb.go",
        "pps.pb.gw.go",
        "pps.pb.validate.go",
        "pps.pb.zap.go",
        "pps_grpc.pb.go",
        "util.go",
    ],
    importpath = "github.com/pachyderm/pachyderm/v2/src/pps",
    visibility = ["//visibility:public"],
    deps = [
        "//src/internal/errors",
        "//src/internal/errutil",
        "//src/pfs",
        "//src/protoextensions",
        "//src/task",
        "@com_github_chrusty_protoc_gen_jsonschema//:protoc-gen-jsonschema",
        "@com_github_envoyproxy_protoc_gen_validate//validate",
        "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime",
        "@com_github_grpc_ecosystem_grpc_gateway_v2//utilities",
        "@org_golang_google_grpc//:grpc",
        "@org_golang_google_grpc//codes",
        "@org_golang_google_grpc//grpclog",
        "@org_golang_google_grpc//metadata",
        "@org_golang_google_grpc//status",
        "@org_golang_google_protobuf//proto",
        "@org_golang_google_protobuf//reflect/protoreflect",
        "@org_golang_google_protobuf//runtime/protoimpl",
        "@org_golang_google_protobuf//types/known/anypb",
        "@org_golang_google_protobuf//types/known/durationpb",
        "@org_golang_google_protobuf//types/known/emptypb",
        "@org_golang_google_protobuf//types/known/timestamppb",
        "@org_golang_google_protobuf//types/known/wrapperspb",
        "@org_uber_go_zap//:zap",
        "@org_uber_go_zap//zapcore",
    ],
)

go_test(
    name = "pps_test",
    size = "small",
    srcs = [
        "filter_test.go",
        "pps_test.go",
    ],
    deps = [
        ":pps",
        "//src/internal/require",
        "//src/pfs",
        "@com_github_google_go_cmp//cmp",
        "@org_golang_google_protobuf//testing/protocmp",
    ],
)

filegroup(
    name = "protos",
    srcs = glob(["*.proto"]),
    visibility = ["//src:__pkg__"],
)
